package com.aaa.system.dao;

import com.aaa.entity.User;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * @InterfaceName ChangePasswordDao
 * @Description
 * @Author 崔灿
 * @LastChangeDate 2023/3/2 15:26
 * @Version v1.0
 */

public interface ChangePasswordDao extends BaseMapper<User> {

    @Select("select password from sys_user where username=#{username}")
    String selectOldPw(String username);

    @Update("update sys_user set password=#{encode} where username=#{username}")
    Integer ChangePassword1(@Param("username") String username, @Param("encode") String encode);
}
